﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Web;
using System.Web.Mvc;
using FotoLab.DomainLayer;
using FotoLab.DomainLayer.Model;
using FotoLab.Models;

namespace FotoLab.Controllers
{
    public class WinkelWagenController : Controller
    {
        //private ProductEntities pe = new ProductEntities();
        public ActionResult Index()
        {
            return View();
        }
        public ActionResult Bestellen(int id, int aantal)
        {
            var contextR = new DomainContext();
            var regels = contextR.Orderregels.ToList();

            //if (Session["winkelwagen"] == null)
            //{
            //    List<WinkelwagenRegel> winkelwagen = new List<WinkelwagenRegel>();
            //    winkelwagen.Add(new WinkelwagenRegel(pe.Products.Find(id), 1));
            //    Session winkelwagen = winkelwagen;
            //}
            //else { }

            if (Session["winkelwagen"] == null)
            {
                List<Orderregel> regel = new List<Orderregel>();
                //regel.Add(new Orderregel(contextR.Producten.Find(id), aantal));
                regel.Add(new Orderregel());
                Session["winkelwagen"] = regel;
            }

            return View("Winkelwagen");
        }
    }
}